<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Kame
 * Date: 20/03/13
 * Time: 08:29 PM
 */
namespace Site\Model;

class User
{
    public $usuario;
    public $pase;
    public $nick;
    public $nombre;
    public $apellido;
    public $correo;
    public $sitioweb;
    public $avatar;
    public $facebook_token;

    public function exchangeArray($data){
        $this->usuario  = (isset($data['usuario']))  ? $data['usuario']  : null;
        $this->pase     = (isset($data['pase'])   )  ? $data['pase']     : null;
        $this->nick     = (isset($data['nick']))     ? $data['nick']     : null;
        $this->nombre   = (isset($data['nombre']))   ? $data['nombre']   : null;
        $this->apellido = (isset($data['apellido'])) ? $data['apellido'] : null;
        $this->correo   = (isset($data['correo']))   ? $data['correo']   : null;
        $this->sitioweb = (isset($data['sitioweb'])) ? $data['sitioweb'] : null;
        $this->avatar   = (isset($data['avatar']))   ? $data['avatar']   : null;
        $this->facebook_token = (isset($data['facebook_token']))    ? $data['facebook_token'] : null;
    }

    public function toArray(){
        return array(
            'usuario' => $this->usuario,
            'pase' => $this->pase,
            'nick' => $this->nick,
            'nombre' => $this->nombre,
            'apellido' => $this->apellido,
            'correo' => $this->correo,
            'sitioweb' => $this->sitioweb,
            'avatar' => $this->avatar,
            'facebook_token' => $this->facebook_token,
        );
    }

}
